package org.hdax.dm.controller;

import org.hdax.dm.request.CreateOrderRequest;
import org.hdax.dm.service.OrderService;
import org.hdax.dm.vo.CommonResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping
public class OrderConstoller {
    @Autowired
    private OrderService orderService;

    /**
     * 下单接口
     *
     * @param createOrderRequest
     * @return
     */
    @PostMapping(path = "/v/createOrder")
    @ResponseBody
    public CommonResponse<Long> createOrder(@RequestBody CreateOrderRequest createOrderRequest) throws Exception {
        return orderService.createOrder(createOrderRequest);
    }


    @GetMapping(path = "/v/nb")
    @ResponseBody
    public Object nv(){
        return "辣阿瓦拉克放假啊文件" +
                "辣味发哈我理解二分" +
                "安慰发来看哈为了克服" +
                "傲文法文立刻反击了卡w阿瓦噶违规" +
                "阿瓦噶为噶为噶为法国阿瓦违法";
    }
}
